<script>
    function click(a) {
        var i;
        for (i = 0; i < document.getElementsByClassName("divs").length; i++) {
            if (i !== a)
                document.getElementsByClassName("divs").item(i).style.display = "none";
            else
                document.getElementsByClassName("divs").item(i).style.display = "block";
        }
        ;
    }
    
    function search(a) {
        var i;
        for (i = 0; i < document.getElementsByClassName("cinput").length; i++) {
            if (i !== a)
                document.getElementsByClassName("cinput").item(i).style.display = "none";
            else
                document.getElementsByClassName("cinput").item(i).style.display = "block";
        }
    }
</script>

<html>
    <head>
        <title>Administracao</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width">
        <link rel="stylesheet" href="css/index.css">
    </head>

    <body>
        <div class="pure-menu pure-menu-open pure-menu-horizontal">
            <a href="#" class="pure-menu-heading">ADMINISTRACAO</a>

            <ul>
                <li class="pure-menu-selected"><a href="#">Home</a></li>
                <li><a href=javascript:click(0)>Cadastrar Funcionario</a></li>
                <li><a href=javascript:click(1)>Consultar Funcionario</a></li>
            </ul>
        </div>

    <center><form class="pure-form pure-form-aligned divs" style="display:none" method="post" action="newMedico.php">
            <fieldset>
                <center><legend>Dados Pessoais</legend></center>

                <div class="pure-control-group">
                    <input name="name" type="text" placeholder="Nome">
                </div>

                <div class="pure-control-group">
                    <input name="lastName" type="text" placeholder="Sobrenome">
                </div>

                <div class="pure-control-group">
                    <input name="rg" type="number" placeholder="RG">
                </div>

                <div class="pure-control-group">
                    <input name="cpf" type="number" placeholder="CPF">
                </div>

                <center><legend>Contatos</legend></center>

                <div class="pure-control-group">
                    <input name="tel1" type="number" placeholder="Telefone 1">
                </div>

                <div class="pure-control-group">
                    <input name="tel2" type="number" placeholder="Telefone 2">
                </div>

                <div class="pure-control-group">
                    <input name="email" type="email" placeholder="E-Mail">
                </div>

                <center><legend>Medico</legend></center>

                <div class="pure-u-1 pure-u-med-1-3">
                    <select name="insurance" class="pure-input-1-2">
                        <option value="">Plano de Saude</option>
                        <option value="Excelsior">Excelsior</option>
                        <option value="GEAP">GEAP</option>
                        <option value="Unlimited">Unimed</option>
                        <option value="SUS">SUS</option>
                        <option value="Particular">Particular</option>
                    </select>
                </div>

                <br>

                <div class="pure-control-group">
                    <input name="crm" type="number" placeholder="CRM">
                </div>

                <div class="pure-control-group">
                    <input name="special" type="text" placeholder="Especialidade">
                </div>

                <center><legend>Institucional</legend></center>

                <div class="pure-u-1 pure-u-med-1-3">
                    <select name="level" class="pure-input-1-2">
                        <option value="">Nivel de Acesso</option>
                        <option value="Medico">Medico</option>
                        <option value="Recepcionista">Recepcionista</option>
                        <option value="Administrador">Administrador</option>
                    </select>
                </div>
                
                <br>

                <div class="pure-control-group">
                    <input name="user" type="text" placeholder="Nome de Usuario">
                </div>

                <div class="pure-control-group">
                    <input name="pass" type="password" placeholder="Senha">
                </div>

                <button type="submit" class="pure-button pure-button-primary">Cadastrar</button>
                </div>

            </fieldset>
        </form></center>
    
        <center><form class="pure-form pure-form-aligned divs" style="display:none" action="oldMedico.php" method="post">
            <div class="pure-menu pure-menu-open">

                <ul>
                    <li><a href="javascript:search(0)">Consultar por CPF</a></li>
                    <li><a href="javascript:search(1)">Consultar por CRM</a></li>
                </ul>
            </div>

            </br>

            <div class="pure-control-group cinput" style="display:none">
                <input name="cpf" type="number" placeholder="CPF">
                
                <br>
                <div class="pure-u-1 pure-u-med-1-3">
                    <select name="level" class="pure-input-1-2">
                        <option value="">Nivel de Acesso</option>
                        <option value="Medico">Medico</option>
                        <option value="Recepcionista">Recepcionista</option>
                        <option value="Administrador">Administrador</option>
                    </select>
                </div>
                
                <button type="submit" class="pure-button pure-button-primary">Consultar</button> 
            </div>

            <div class="pure-control-group cinput" style="display:none">
                <input name="id" type="number" placeholder="CRM">
                <input name="level" type="hidden" value="Medico">
                <button type="submit" class="pure-button pure-button-primary">Consultar</button> 
            </div>

        </form></center>
</body>       
</html>
